package com.cm.stock.manager.service;

import com.cm.stock.manager.dao.FamilleDAO;
import com.cm.stock.manager.dto.FamilleDTO;

public class FamilleService {
	
	private FamilleDAO familleDAO;
	
	public FamilleDTO getFamilleByCode (String code){
		return familleDAO.getByCode(code);
	}
	
	public FamilleDTO saveFamille (String code, String description){
		return familleDAO.save(new FamilleDTO(code, description));
	}
	
	public FamilleDTO updateFamille (FamilleDTO famille){
		return familleDAO.update(famille);
	}
	
	public void deleteFamille (Integer id) throws Exception{
		familleDAO.deleteOne(id);
	}

	public void setFamilleDAO(FamilleDAO familleDAO) {
		this.familleDAO = familleDAO;
	}
	
	

}
